package com.wealth.scsj.b_app.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wealth.scsj.b_app.R;
import com.wealth.scsj.b_app.bean.RightCommBean;
import java.util.List;

/**
 *  右侧评论列表
 */

public class RightCommAdapter extends BaseQuickAdapter<RightCommBean, BaseViewHolder> {

    private Context mContext;
    private List data;

    public RightCommAdapter(Context mContext, List data) {
        super(R.layout.item_comm_ana_layout, data);
        this.mContext = mContext;
        this.data= data;
    }

    @Override
    protected void convert(BaseViewHolder helper, RightCommBean item) {

//        helper.setImageResource(R.id.mark_iv, item.getType());
//        Glide.with(mContext).load(item.getIcon()).into((ImageView) helper.getView(R.id.icon_iv));
//        helper.setText(R.id.title_tv, item.getTitle());
//        helper.setText(R.id.num_tv,item.getNum());
//        helper.setText(R.id.sale_tv,item.getSale());



       int position= helper.getLayoutPosition();
        if (position==0){
            helper.setImageResource(R.id.mark_iv,R.mipmap.one_pic);
        }else if (position==1){
            helper.setImageResource(R.id.mark_iv,R.mipmap.two_pic);
        }else if (position==2){
            helper.setImageResource(R.id.mark_iv,R.mipmap.three_pic);
        }else {
            helper.getView(R.id.mark_iv).setVisibility(View.GONE);
        }


    }
}
